package com.jr.util;


import java.util.ArrayList;

public class PageHelper {
    /**
     * 每页有多少条数据,默认每页4条数据
     */
    private Integer showCount;
    /**
     * 一共有多少条数据
     */
    private Integer dataCount;
    /**
     * 一共能分多少页？ 算术运算获得结果。
     */
    private Integer pageCount;
    /**
     * 当前是第几页，默认当前是第1页
     */
    private Integer indexPage ;
    /**
     * 当前页要显示的集合数据
     */
    private ArrayList list;


    public PageHelper() {
    }

    public PageHelper(Integer showCount, Integer dataCount, Integer pageCount, Integer indexPage, ArrayList list) {
        this.showCount = showCount;
        this.dataCount = dataCount;
        this.pageCount = pageCount;
        this.indexPage = indexPage;
        this.list = list;
    }

    public Integer getShowCount() {
        return showCount;
    }

    public void setShowCount(Integer showCount) {
        this.showCount = showCount;
    }

    public Integer getDataCount() {
        return dataCount;
    }

    public void setDataCount(Integer dataCount) {
        this.dataCount = dataCount;
    }

    public Integer getPageCount() {
        //一共有12条数据，每页显示4条数据：一共有多少页 13%4==0  ？ 13/4 :  13/4+!
        return this.pageCount;
    }

    public void setPageCount(Integer pageCount ) {
       this.pageCount = pageCount;
    }

    public Integer getIndexPage() {
        return indexPage;
    }

    public void setIndexPage(Integer indexPage) {
        this.indexPage = indexPage;
    }

    public ArrayList getList() {
        return list;
    }

    public void setList(ArrayList list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "PageHelper{" +
                "showCount=" + showCount +
                ", dataCount=" + dataCount +
                ", pageCount=" + pageCount +
                ", indexPage=" + indexPage +
                ", list=" + list +
                '}';
    }
}
